Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes issues with sorting by price, but does not address category sorting preferences being ignored (I'm not sure where those settings can be found).
Changing search order via the select menu functions correctly (tested name and price, both ASC and DESC) except that the default sort for the initial search appears to be by relevance while the dropdown menu shows 'Name (A-Z)' as the currently selected method. This means that the initial search results appear to be mis-ordered, but it is merely a mis-display of the selected option.
Keying off of
G.product_id
is more correct as it only uses the group pricing if the group itself exists, whereasG.sale_price
can be null both when the group doesn't exist and when the group doesn't have a sale price.Furthermore,
sale_price
can have a value of eithernull
or0.00
, both of which should be considered non-values for purposes of sorting by price.